<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        #box{
            width: 200px;
            height: 200px;
            margin: 0 auto;
        }
        #header{
            width: 180px;
            height: 35px;
            background-color: #b6b9c7;
            color: #474958;
            border: 1px solid #aaaaaa;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        #list{
            width: 180px;
            background-color: #e9edf2;
            border: 1px solid #aaaaaa;
        }
        li{
            padding: 3px 2px;
            color: #6b7980;
        }
        #direction{
            border-top: 6px solid #000;
            border-left: 6px solid rgba(0, 0, 0 , 0);
            border-right: 6px solid rgba(0, 0, 0 , 0);
            float: right;
            
        }
        #list li:hover{
            background-color: #fff;
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div id="box">
        <div id="header">
            <p>播放列表...</p>
            <div id="direction"></div>
        </div>
        <ul id="list">
            <li>玩家之徒</li>
            <li>原谅我就是这样的女生</li>
            <li>猜不透</li>
            <li>自导自演</li>
            <li>流年</li>
        </ul>
    </div>
</body>
<script>
    window.onload = function(){
        var header = document.querySelector('#header')
        var list = document.querySelector('#list')
        var direction = document.querySelector('#direction')
        var style = list.style
        header.onclick = function() {
            if(list.style.display != 'none'){
                list.style.cssText = 'display:none';
                direction.style.cssText=
                "border-top:0 solid #000; border-bottom:6px solid #000;"

            }else{
                list.style.cssText = ""
                direction.style.cssText = ""
            }
        }
    }
</script>
</html>